
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"  
      xmlns:h="http://java.sun.com/jsf/html"  
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"> 

    <h:head>
        <title>#{bundle['login.touristLogin.title']}</title>
    </h:head>
    <h:body>
        <h:form id="touristLogin">  
            <!-- LOCALIZATION -->
            <!-- this selectedLocale menu must always be at the top of the form -->
            <h:selectOneMenu id="selectedLocale" value="#{indexManagedBean.selectedLocale}">
                <f:selectItems value="#{enumLanguage.listItems}" />

                <p:ajax update="login.header.panel
                                touristLoginUsernameLabel
                                touristLoginPasswordLabel
                                remember_me
                                loginLoginButton" 
                        listener="#{indexManagedBean.selectedLocaleValueChangeListener}" />
            </h:selectOneMenu>
            <!-- this end selectedLocale menu must always be at the top of the form -->
            <!-- END LOCALIZATION -->
            
            
            
            <!-- panel for dividing web page into sections -->
            <p:panel id="panel" header="#{bundle['login.header.panel']}" style="margin-bottom:10px;">  
                <p:messages />  <!-- for displaying ALL messages -->

                <h:panelGrid columns="3"> <!-- columns will be auto applied as long as u can divide the number of components equally -->
                    <h:outputText id="touristLoginUsernameLabel" value ="#{bundle['login.username.label']}" />
                    <p:inputText id="username" required="true" label="username" requiredMessage="#{bundle['login.username.required']}" value="#{touristLoginManagedBean.username}" />
                    <p:message for="username"/>
                    
                    <h:outputLabel id="touristLoginPasswordLabel" value="#{bundle['login.password.label']}" />
                    <h:inputSecret id="password" required="true" label="password" requiredMessage="#{bundle['login.password.required']}" value="#{touristLoginManagedBean.password}" />
                    <p:message for="password"/>
                </h:panelGrid>
               
                
                <p:commandButton id="loginLoginButton" value="#{bundle['login.login.button']}" update="panel" actionListener="#{touristLoginManagedBean.doLogin}"/>
            </p:panel>  
            
            <h:panelGrid columns="2">
                <h:selectBooleanCheckbox id="remember_me"/> <h:outputLabel value="Remember me!"/>
                <br></br><br></br>
                <h:commandLink value ="Forgot/Change Password?"/>
            </h:panelGrid>
        </h:form>
    </h:body>
</html>

